<?php

namespace frontend\modules\discover\controllers;

use Yii;
use frontend\components\Controller;
use frontend\modules\discover\models\ArticleSearch;
use frontend\modules\discover\models\RecentArticleSearch;

/**
 * 文章相关接口
 * ArticleController controller for the `discover` module
 */
class ArticleController extends Controller {

    /**
     * @inheritdoc
     */
    public function actionIndex() {
        $modelClass = new ArticleSearch();
        return $modelClass->search();
    }

    /**
     * @inheritdoc
     */
    public function actionRecent($time) {
        $model = new RecentArticleSearch();
        $model->rectime = $time;
        return $model->search();
    }

}
